home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / evcode.h < prev    next >
Text File  |  2001-10-08  |  17KB  |  416 lines

  1. //------------------------------------------------------------------------------
  2. // File: EvCode.h
  3. //
  4. // Desc: List of standard Quartz event codes and the expected params.
  5. //
  6. // Copyright (c) 1992 - 2001, Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9.  
  10. // Event codes are broken into two groups
  11. //   -- system event codes
  12. //   -- extension event codes
  13. // All system event codes are below EC_USER
  14.  
  15. #define EC_SYSTEMBASE                       0x00
  16. #define EC_USER                             0x8000
  17.  
  18. // System-defined event codes
  19. // ==========================
  20. //
  21. // There are three types of system-defined event codes:
  22. //
  23. // 1.  Those which are always passed through to the application
  24. //     (To be collected by calls to GetEvent or within WaitForCompletion.)
  25. //     (e.g. EC_ERRORABORT, EC_USERABORT.)
  26. //
  27. // 2.  Those which are pure internal and will never be passed to
  28. //     the application.  (e.g. EC_SHUTDOWN)
  29. //
  30. // 3.  Those which have default handling.  Default handing implies that
  31. //     the event is not passed to the application.  However, default
  32. //     handling may be canceled by calling
  33. //     IMediaEvent::CancelDefaultHandling.  If the default handling is
  34. //     cancelled in this way, then the message will be delivered to the
  35. //     application and the application must action it appropriately.
  36. //     Default handling can be restored by calling RestoreDefaultHandling.
  37. //
  38. // We will refer to these events as application, internal and defaulted
  39. // events respectively.
  40. //
  41. // System-defined events may have interface pointers, BSTR's, etc passed
  42. // as parameters.  It is therefore essential that, for any message
  43. // retrieved using GetEvent, a matching call to FreeEventParams is made
  44. // to ensure that relevant interfaces are released and storage freed.
  45. // Failure to call FreeEventParams will result in memory leaks, if not
  46. // worse.
  47. //
  48. // Filters sending these messages to the filter graph should not AddRef()
  49. // any interfaces that they may pass as parameters.  The filter graph
  50. // manager will AddRef them if required.  E.g. if the event is to be queued
  51. // for the application or queued to a worker thread.
  52.  
  53. // Each event listed below is immediately followed by a parameter list
  54. // detailing the types of the parameters associated with the message,
  55. // and an indication of whether the message is an application, internal
  56. // or defaulted message.  This is then followed by a short description.
  57. // The use of "void" in the parameter list implies that the parameter is not
  58. // used.  Such parameters should be zero.
  59.  
  60. // Other defined EC_ regions:
  61. // DVD event codes           0x0100 - 0x0150 (dvdevcod.h)
  62. // audio device event codes  0x0200 - 0x0250 (audevcod.h)
  63. // WindowsMedia SDK-originated events 0x0251 - 0x0300 (see below)
  64. // MSVIDCTL                  0x0301 - 0x0325 (msvidctl.idl)
  65.  
  66. #define EC_COMPLETE                         0x01
  67. // ( HRESULT, void ) : defaulted (special)
  68. // Signals the completed playback of a stream within the graph.  This message
  69. // is sent by renderers when they receive end-of-stream.  The default handling
  70. // of this message results in a _SINGLE_ EC_COMPLETE being sent to the
  71. // application when ALL of the individual renderers have signaled EC_COMPLETE
  72. // to the filter graph.  If the default handing is canceled, the application
  73. // will see all of the individual EC_COMPLETEs.
  74.  
  75.  
  76. #define EC_USERABORT                        0x02
  77. // ( void, void ) : application
  78. // In some sense, the user has requested that playback be terminated.
  79. // This message is typically sent by renderers that render into a
  80. // window if the user closes the window into which it was rendering.
  81. // It is up to the application to decide if playback should actually
  82. // be stopped.
  83.  
  84.  
  85. #define EC_ERRORABORT                       0x03
  86. // ( HRESULT, void ) : application
  87. // Operation aborted because of error
  88.  
  89.  
  90. #define EC_TIME                             0x04
  91. // ( DWORD, DWORD ) : application
  92. // The requested reference time occurred.  (This event is currently not used).
  93. // lParam1 is low dword of ref time, lParam2 is high dword of reftime.
  94.  
  95.  
  96. #define EC_REPAINT                          0x05
  97. // ( IPin * (could be NULL), void ) : defaulted
  98. // A repaint is required - lParam1 contains the (IPin *) that needs the data
  99. // to be sent again. Default handling is: if the output pin which the IPin is
  100. // attached  to supports the IMediaEventSink interface then it will be called
  101. // with the EC_REPAINT first.  If that fails then normal repaint processing is
  102. // done by the filter graph.
  103.  
  104.  
  105. // Stream error notifications
  106. #define EC_STREAM_ERROR_STOPPED             0x06
  107. #define EC_STREAM_ERROR_STILLPLAYING        0x07
  108. // ( HRESULT, DWORD ) : application
  109. // lParam 1 is major code, lParam2 is minor code, either may be zero.
  110.  
  111.  
  112. #define EC_ERROR_STILLPLAYING               0x08
  113. // ( HRESULT, void ) : application
  114. // The filter graph manager may issue Run's to the graph asynchronously.
  115. // If such a Run fails, EC_ERROR_STILLPLAYING is issued to notify the
  116. // application of the failure.  The state of the underlying filters
  117. // at such a time will be indeterminate - they will all have been asked
  118. // to run, but some are almost certainly not.
  119.  
  120.  
  121. #define EC_PALETTE_CHANGED                  0x09
  122. // ( void, void ) : application
  123. // notify application that the video palette has changed
  124.  
  125.  
  126. #define EC_VIDEO_SIZE_CHANGED               0x0A
  127. // ( DWORD, void ) : application
  128. // Sent by video renderers.
  129. // Notifies the application that the native video size has changed.
  130. // LOWORD of the DWORD is the new width, HIWORD is the new height.
  131.  
  132.  
  133. #define EC_QUALITY_CHANGE                   0x0B
  134. // ( void, void ) : application
  135. // Notify application that playback degradation has occurred
  136.  
  137.  
  138. #define EC_SHUTTING_DOWN                    0x0C
  139. // ( void, void ) : internal
  140. // This message is sent by the filter graph manager to any plug-in
  141. // distributors which support IMediaEventSink to notify them that
  142. // the filter graph is starting to shutdown.
  143.  
  144.  
  145. #define EC_CLOCK_CHANGED                    0x0D
  146. // ( void, void ) : application
  147. // Notify application that the clock has changed.
  148. // (i.e. SetSyncSource has been called on the filter graph and has been
  149. // distributed successfully to the filters in the graph.)
  150.  
  151.  
  152. #define EC_PAUSED                           0x0E
  153. // ( HRESULT, void ) : application
  154. // Notify application the previous pause request has completed
  155.  
  156.  
  157. #define EC_OPENING_FILE                     0x10
  158. #define EC_BUFFERING_DATA                   0x11
  159. // ( BOOL, void ) : application
  160. // lParam1 == 1   --> starting to open file or buffer data
  161. // lParam1 == 0   --> not opening or buffering any more
  162. // (This event does not appear to be used by ActiveMovie.)
  163.  
  164.  
  165. #define EC_FULLSCREEN_LOST                  0x12
  166. // ( void, IBaseFilter * ) : application
  167. // Sent by full screen renderers when switched away from full screen.
  168. // IBaseFilter may be NULL.
  169.  
  170.  
  171. #define EC_ACTIVATE                         0x13
  172. // ( BOOL, IBaseFilter * ) : internal
  173. // Sent by video renderers when they lose or gain activation.
  174. // lParam1 is set to 1 if gained or 0 if lost
  175. // lParam2 is the IBaseFilter* for the filter that is sending the message
  176. // Used for sound follows focus and full-screen switching
  177.  
  178.  
  179. #define EC_NEED_RESTART                     0x14
  180. // ( void, void ) : defaulted
  181. // Sent by renderers when they regain a resource (e.g. audio renderer).
  182. // Causes a restart by Pause/put_Current/Run (if running).
  183.  
  184.  
  185. #define EC_WINDOW_DESTROYED                 0x15
  186. // ( IBaseFilter *, void ) : internal
  187. // Sent by video renderers when the window has been destroyed. Handled
  188. // by the filter graph / distributor telling the resource manager.
  189. // lParam1 is the IBaseFilter* of the filter whose window is being destroyed
  190.  
  191.  
  192. #define EC_DISPLAY_CHANGED                  0x16
  193. // ( IPin *, void ) : internal
  194. // Sent by renderers when they detect a display change. the filter graph
  195. // will arrange for the graph to be stopped and the pin send in lParam1
  196. // to be reconnected. by being reconnected it allows a renderer to reset
  197. // and connect with a more appropriate format for the new display mode
  198. // lParam1 contains an (IPin *) that should be reconnected by the graph
  199.  
  200.  
  201. #define EC_STARVATION                       0x17
  202. // ( void, void ) : defaulted
  203. // Sent by a filter when it detects starvation. Default handling (only when
  204. // running) is for the graph to be paused until all filters enter the
  205. // paused state and then run. Normally this would be sent by a parser or source
  206. // filter when too little data is arriving.
  207.  
  208.  
  209. #define EC_OLE_EVENT                        0x18
  210. // ( BSTR, BSTR ) : application
  211. // Sent by a filter to pass a text string to the application.
  212. // Conventionally, the first string is a type, and the second a parameter.
  213.  
  214.  
  215. #define EC_NOTIFY_WINDOW                    0x19
  216. // ( HWND, void ) : internal
  217. // Pass the window handle around during pin connection.
  218.  
  219. #define EC_STREAM_CONTROL_STOPPED           0x1A
  220. // ( IPin * pSender, DWORD dwCookie )
  221. // Notification that an earlier call to IAMStreamControl::StopAt
  222. // has now take effect.  Calls to the method can be marked
  223. // with a cookie which is passed back in the second parameter,
  224. // allowing applications to easily tie together request
  225. // and completion notifications.
  226. //
  227. // NB: IPin will point to the pin that actioned the Stop.  This
  228. // may not be the pin that the StopAt was sent to.
  229.  
  230. #define EC_STREAM_CONTROL_STARTED           0x1B
  231. // ( IPin * pSender, DWORD dwCookie )
  232. // Notification that an earlier call to IAMStreamControl::StartAt
  233. // has now take effect.  Calls to the method can be marked
  234. // with a cookie which is passed back in the second parameter,
  235. // allowing applications to easily tie together request
  236. // and completion notifications.
  237. //
  238. // NB: IPin will point to the pin that actioned the Start.  This
  239. // may not be the pin that the StartAt was sent to.
  240.  
  241. #define EC_END_OF_SEGMENT                   0x1C
  242. //
  243. // ( const REFERENCE_TIME *pStreamTimeAtEndOfSegment, DWORD dwSegmentNumber )
  244. //
  245. // pStreamTimeAtEndOfSegment
  246. //     pointer to the accumulated stream clock
  247. //     time since the start of the segment - this is directly computable
  248. //     as the sum of the previous and current segment durations (Stop - Start)
  249. //     and the rate applied to each segment
  250. //     The source add this time to the time within each segment to get
  251. //     a total elapsed time
  252. //
  253. // dwSegmentNumber
  254. //     Segment number - starts at 0
  255. //
  256. // Notifies that a segment end has been reached when the
  257. // AM_SEEKING_Segment flags was set for IMediaSeeking::SetPositions
  258. // Passes in an IMediaSeeking interface to allow the next segment
  259. // to be defined by the application
  260.  
  261. #define EC_SEGMENT_STARTED                  0x1D
  262. //
  263. // ( const REFERENCE_TIME *pStreamTimeAtStartOfSegment, DWORD dwSegmentNumber)
  264. //
  265. // pStreamTimeAtStartOfSegment
  266. //     pointer to the accumulated stream clock
  267. //     time since the start of the segment - this is directly computable
  268. //     as the sum of the previous segment durations (Stop - Start)
  269. //     and the rate applied to each segment
  270. //
  271. // dwSegmentNumber
  272. //     Segment number - starts at 0
  273. //
  274. // Notifies that a new segment has been started.
  275. // This is sent synchronously by any entity that will issue
  276. // EC_END_OF_SEGMENT when a new segment is started
  277. // (See IMediaSeeking::SetPositions - AM_SEEKING_Segment flag)
  278. // It is used to compute how many EC_END_OF_SEGMENT notifications
  279. // to expect at the end of a segment and as a consitency check
  280.  
  281.  
  282. #define EC_LENGTH_CHANGED                  0x1E
  283. // (void, void)
  284. // sent to indicate that the length of the "file" has changed
  285.  
  286. #define EC_DEVICE_LOST                     0x1f
  287. // (IUnknown, 0)
  288. //
  289. // request window notification when the device is available again
  290. // (through WM_DEVICECHANGED messages registered with
  291. // RegisterDeviceNotification; see IAMDeviceRemoval interface)
  292.  
  293. #define EC_STEP_COMPLETE                      0x24
  294. // (BOOL bCacelled, void)
  295. // Step request complete
  296. // if bCancelled is TRUE the step was cancelled.  This can happen
  297. // if the application issued some control request or because there
  298. // was a mode change etc etc
  299.  
  300. // Event code 25 is reserved for future use.
  301.  
  302. #define EC_TIMECODE_AVAILABLE           0x30
  303. // Sent by filter supporting timecode
  304. // Param1 has a pointer to the sending object
  305. // Param2 has the device ID of the sending object
  306.  
  307. #define EC_EXTDEVICE_MODE_CHANGE        0x31
  308. // Sent by filter supporting IAMExtDevice
  309. // Param1 has the new mode
  310. // Param2 has the device ID of the sending object
  311.  
  312. #define EC_STATE_CHANGE                    0x32
  313. // ( FILTER_STATE, BOOL bInternal)
  314. // Used to notify the application of any state changes in the filter graph.
  315. // lParam1  is of type enum FILTER_STATE (defined in strmif.h) and indicates
  316. //          the state of the filter graph.
  317. //
  318. // lParam2 == 0 indicates that the previous state change request has completed
  319. //              & a change in application state.
  320. // lParam2 == 1 reserved for future use to indicate internal state changes.
  321.  
  322.  
  323. #define EC_GRAPH_CHANGED                        0x50
  324. // Sent by filter to notify interesting graph changes
  325.  
  326. #define EC_CLOCK_UNSET                      0x51
  327. // ( void, void ) : application
  328. // Used to notify the filter graph to unset the current graph clock.
  329. // Has the affect of forcing the filter graph to reestablish the graph clock
  330. // on the next Pause/Run (note that this is only used by ksproxy, when the pin
  331. // of a clock providing filter is disconnected)
  332.  
  333. #define EC_VMR_RENDERDEVICE_SET                 0x53
  334. // (Render_Device type, void)
  335. // Identifies the type of rendering mechanism the VMR
  336. // is using to display video.  Types used include:
  337. #define VMR_RENDER_DEVICE_OVERLAY       0x01
  338. #define VMR_RENDER_DEVICE_VIDMEM        0x02
  339. #define VMR_RENDER_DEVICE_SYSMEM        0x04
  340.  
  341.  
  342. #define EC_VMR_SURFACE_FLIPPED          0x54
  343. // (hr - Flip return code, void)
  344. // Identifies the VMR's allocator-presenter has called the DDraw flip api on
  345. // the surface being presented.   This allows the VMR to keep its DX-VA table
  346. // of DDraw surfaces in sync with DDraws flipping chain.
  347.  
  348. #define EC_VMR_RECONNECTION_FAILED      0x55
  349. // (hr - ReceiveConnection return code, void)
  350. // Identifies that an upstream decoder tried to perform a dynamic format
  351. // change and the VMR was unable to accept the new format.
  352.  
  353.  
  354.  
  355. //------------------------------------------
  356. //
  357. //  BDA events:
  358. //
  359. //      Event code 0x80 through 0x8f are reserved for BDA
  360. //
  361.  
  362.  
  363. //------------------------------------------
  364. //
  365. // WindowsMedia SDK filter-specific events:
  366. //
  367. // 
  368. // Note that for EC_WMT_EVENT events the wmsdk-based filters use the following structure for 
  369. // passing event parameters to the app:
  370. #ifndef AM_WMT_EVENT_DATA_DEFINED
  371. #define AM_WMT_EVENT_DATA_DEFINED
  372. typedef struct {
  373.     HRESULT hrStatus;        // status code
  374.     void * pData;            // event data
  375. } AM_WMT_EVENT_DATA;
  376. #endif
  377. //
  378. #define EC_WMT_EVENT_BASE                  0x0251
  379. //
  380. #define EC_WMT_INDEX_EVENT                  EC_WMT_EVENT_BASE
  381. // WindowsMedia SDK-originated file indexing status, sent by WMSDK-based filters
  382. //
  383. // lParam1 is one of the enum WMT_STATUS messages listed below, sent by the WindowsMedia SDK
  384. // lParam2 is specific to the lParam event
  385. //
  386. //     the following WMT_STATUS messages are sent for this event:
  387. //         WMT_STARTED        - lParam2 is 0
  388. //         WMT_CLOSED         - lParam2 is 0
  389. //         WMT_INDEX_PROGRESS - lParam2 is a DWORD containing the progress percent complete
  390. //
  391. #define EC_WMT_EVENT                        EC_WMT_EVENT_BASE+1
  392. // WindowsMedia SDK-originated event, sent by WMSDK-based filters
  393. //
  394. // lParam1 is one of the enum WMT_STATUS messages listed below, sent by the WindowsMedia SDK
  395. // lParam2 is a pointer an AM_WMT_EVENT_DATA structure where,
  396. //                          hrStatus is the status code sent by the wmsdk
  397. //                          pData is specific to the lParam1 event
  398. // 
  399. //     the following WMT_STATUS messages are sent by the WMSDK Reader filter for this event:
  400. //         WMT_NO_RIGHTS        - pData is a pointer to a WCHAR string containing a challenge URL
  401. //         WMT_ACQUIRE_LICENSE  - lParam2 is a pointer to a WM_GET_LICENSE_DATA struct
  402. //         WMT_NO_RIGHTS_EX     - lParam2 is a pointer to a WM_GET_LICENSE_DATA struct
  403. //         WMT_NEEDS_INDIVIDUALIZATION - lParam2 is NULL
  404. //         WMT_INDIVIDUALIZE    - lParam2 is a pointer to a WM_INDIVIDUALIZE_STATUS struct
  405. //
  406. // end WMSDK-originated events
  407. //-----------------------------------------
  408.  
  409.  
  410. #define EC_BUILT                            0x300
  411. // Sent to notify transition from unbuilt to built state
  412.  
  413.  
  414. #define EC_UNBUILT                          0x301
  415. // Sent to notify transtion from built to unbuilt state
  416.